package org.example.liaoxuefeng;


import org.example.liaoxuefeng.node.SpanNode;
import org.example.liaoxuefeng.node.TextNode;
import org.example.liaoxuefeng.node.decorator.BoldDecorator;
import org.example.liaoxuefeng.node.decorator.ItalicDecorator;
import org.example.liaoxuefeng.node.decorator.UnderlineDecorator;

import java.io.IOException;

/**
 * Learn Java from https://www.liaoxuefeng.com/
 *
 * @author liaoxuefeng
 */
public class Main {

    public static void main(String[] args) throws IOException {
        TextNode n1 = new SpanNode();
        TextNode n2 = new BoldDecorator(new UnderlineDecorator(new SpanNode()));
        TextNode n3 = new ItalicDecorator(new BoldDecorator(new SpanNode()));
        n1.setText("Hello");
        n2.setText("Decorated");
        n3.setText("World");
        System.out.println(n1.getText());
        System.out.println(n2.getText());
        System.out.println(n3.getText());
    }
}
